import js from "@eslint/js"
import globals from "globals"
import pluginVue from "eslint-plugin-vue"
import { defineConfig } from "eslint/config"
import vueEslintParser from 'vue-eslint-parser'

export default defineConfig([
  {
    files: ["**/*.{js,mjs,cjs,vue}"],
    languageOptions: {
      parser: vueEslintParser,
      globals: {
        ...globals.browser, // 添加浏览器环境的全局变量，包括 console
        ...globals.node // 添加 Node.js 环境的全局变量
      }
    },
    plugins: {
      js,
      vue: pluginVue
    },
    extends: ["js/recommended"],
    rules: {
      'vue/multi-word-component-names': 'off',
      'semi': ['error', 'never'],
      'no-multiple-empty-lines': ['error', { 'max': 1, 'maxEOF': 1 }]
    }
  }
])
